Add Array API inspection utilities#689
Conversation
|
This looks pretty good to me overall, thanks @kgryte. |
|
I've updated this PR to use a protocol instead of a data class. I believe this PR should be ready for final review. |
rgommers
left a comment
There was a problem hiding this comment.
The way this PR is written and without looking at the linked discussions, it's not quite clear to me whether __array_namespace_info__ is an array method or a function in the namespace returned by array.__array_namespace__.
In addition, it could be useful to clarify in the __array_namespace_info__ docs that the returned object from that function/method may be either a namespace or a class; as long as the user can do this:
info = __array_namespace_info__()
info.capabilities()
info.devices()
info.dtypes()
info.default_dtypes()|
IIRC there were a few more things discussed for inclusion in the inspection API:
|
I was planning on submitting follow-up PR(s) to avoid potential bikesheds and avoid piggybacking on this PR, but I can include some of the aforementioned additional capabilities in this PR. I don't have a strong opinion, except wanting to get this in sooner rather than later. |
|
@rgommers The updated
|
leofang
left a comment
There was a problem hiding this comment.
LGTM from my perspective. I'm keen to see this PR merged so that we can start addressing follow-up works (ex: #689 (comment)).
Ping @oleksandr-pavlyk for review, due to its relevance 🙂
rgommers
left a comment
There was a problem hiding this comment.
LGTM too now, modulo the one typo.
leofang
left a comment
There was a problem hiding this comment.
Two nits on formatting, but content-wise we're good to go!
Co-authored-by: Leo Fang <leo80042@gmail.com>
|
Thanks to Athan for driving this and all for help! |


This PR